package com.crealth.db;


import org.apache.log4j.Logger;

import com.crealth.manager.MybatisManager;
import com.crealth.model.SupportedVoiceCodecsModel;

public class SupportedVoiceCodecsDb {
	private static Logger errorLog = Logger.getLogger("error_log");
	
	public static void insertSupportedVoiceCodecs(int companyID) {
		MybatisManager.voiceCodecsMapper.insertSupportedVoiceCodecs(companyID);
		MybatisManager.commit();
	}
	
	public static SupportedVoiceCodecsModel selectSupportedVoiceCodecs(int companyID) {
		try {
			SupportedVoiceCodecsModel codecsModel = MybatisManager.voiceCodecsMapper.selectSupportedVoiceCodecs(companyID);
		
			return codecsModel;
		} catch (Exception e) {
			errorLog.error("selectSupportedVoiceCodecs", e);
			return null;
		}
	}
	
	public static Integer updateSupportedVoiceCodecs(SupportedVoiceCodecsModel voiceCodecs) {
		Integer res = MybatisManager.voiceCodecsMapper.updateSupportedVoiceCodecs(voiceCodecs);
		MybatisManager.commit();
		
		return res;
	}

}
